<div id="listDataGridToolbar">
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
       onclick="javascript:$('#ff').form('clear');$('#win').window('open');">添加</a>
    <!--<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">编辑</a>-->
</div>
<table class="easyui-datagrid" title="基础设置" id="listDataGrid"
       data-options="singleSelect:true,collapsible:true,url:'sys/options-json',method:'get',pagination:true,rownumbers:true,fit:true">
    <thead>
    <tr>
        <th data-options="field:'optionsCode',width:80,align:'center'">配置Code</th>
        <th data-options="field:'optionsType',width:80,align:'center'">配置类型</th>
        <th data-options="field:'optionsValue',width:100,align:'center'">配置值</th>
        <th data-options="field:'optionsDesc',width:80,align:'center'">配置描述</th>
        <th data-options="field:'lang',width:50,align:'center'">语言</th>
        <th data-options="field:'crtUser',width:80,align:'center'">创建人</th>
        <th data-options="field:'crtTime',width:60,align:'center'">创建时间</th>
        <th data-options="field:'updUser',width:60,align:'center'">更新人</th>
        <th data-options="field:'updTime',width:60,align:'center'">更新时间</th>
    </tr>
    </thead>
</table>

<div id="win" class="easyui-window" title="添加配置"
     data-options="modal:true,closed:true" style="width:600px;height:400px">
    <div style="padding:10px 60px 20px 60px">
        <form id="ff" method="post">
            <table style="width: 100%;" border="0">
                <tr>
                    <td>配置Code:</td>
                    <td><input class="easyui-textbox" type="text" name="optionsCode" data-options="required:true"/>
                    </td>
                    <td>配置类型:</td>
                    <td><input class="easyui-textbox" type="text" name="optionsType" data-options="required:true"/>
                    </td>
                </tr>
                <tr>
                    <td>配置序号:</td>
                    <td><input class="easyui-numberbox" type="text" name="optionsNo" data-options="required:true"/></td>
                    <td>配置值:</td>
                    <td><input class="easyui-textbox" type="text" name="optionsValue" data-options="required:true"/>
                    </td>
                </tr>
                <tr>
                    <td>语言:</td>
                    <td>
                        <select class="easyui-combobox" name="lang" style="width:57%;"
                                data-options="panelHeight:'auto'">
                            <option value="中文" selected="selected">中文</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>配置描述:</td>
                    <td><input class="easyui-textbox" name="optionsDesc" data-options="multiline:true"
                               style="height:60px;width: 100%;"/></td>
                </tr>
            </table>
        </form>
        <div style="text-align:center;padding:30px">
            <a href="javascript:void(0)" class="easyui-linkbutton" onclick="fSubmitForm()">提交</a>
            <a href="javascript:void(0)" class="easyui-linkbutton"
               onclick="javascript:$('#win').window('close');">关闭</a>
        </div>
    </div>
</div>

<script>
    $('#listDataGrid').datagrid({
        toolbar: '#listDataGridToolbar'
    });

    // 提交表单动作
    function fSubmitForm() {
        $("#ff").form('submit', {
            url: 'sys/saveOrUpdate',
            onSubmit: function (param) {
//                param.crtTime = '2018-01-01';
//                param.updTime = '2018-01-01';
            },
            success: function (data) {
                $('#ff').form('clear');
                $('#win').window('close');
                $.messager.alert('提示', JSON.parse(data).msg);
                $('#listDataGrid').datagrid('reload');
            }
        });
    }
</script>